import data from './data.js'; //筛选菜单数据

export default {
	data() {
		return {
			listTop:0,
			list: [{
				name:'dsd',
				id:'1'
			},
			{
				name:'dsd',
				id:'1'
			},
			{
				name:'dsd',
				id:'1'
			},
			{
				name:'dsd',
				id:'1'
			},
			{
				name:'dsd',
				id:'1'
			},
			{
				name:'dsd',
				id:'1'
			}],
			tablist:[
				{
					name: '今日动销'
				},
				{
					name: '本月动销'
				},
				{
					name: '优惠券'
				},
				{
					name: 'VIP1'
				},
				{
					name: 'VIP1'
				},
				{
					name: 'VIP1'
				},
				{
					name: 'VIP1'
				},
				{
					name: 'VIP1'
				},
				{
					name: '本月动销'
				}
			],
			categoryModelTest:{},
			categoryModel:{},
			listStyle: '',
			loadingType: 'loading', //加载更多状态
			orderType: '',
			priceOrder: 'desc', //1 价格从低到高 2价格从高到低
			categoryList: [], //排序类型
			goodsList: [],
			order: '',
			sort: 'desc',
			showScreen: false,
			keyword: '',
			categoryId: 0,
			minPrice: '',
			maxPrice: '',
			isFreeShipping: false, //是否免邮
			isIphoneX: false,
			coupon: 0,
			emptyShow: false,
			isList: false,//列表样式
			allCateList:[],
			diyData: {
				
			},
			showScree:false,
			height: "400px", // 需要固定swiper的高度
			tabIndex: 0 ,// 当前tab的下标
		}
	},

	onLoad(options) {
		// console.log(options)
		var obj;
		// #ifdef APP-PLUS
		if(options.obj){
			obj = JSON.parse(options.obj);
		}
		// #endif
		// #ifdef MP-WEIXIN
		if(options.obj){
			obj = JSON.parse(decodeURIComponent(options.obj));
		}
		// #endif 
		var listTop = 100;
		this.listTop = listTop; 
		// this.isIphoneX = this.$util.uniappIsIPhoneX();
		this.height = uni.getSystemInfoSync().windowHeight  + 'px'
	 

	},
	onShow() {
		 
	},
	methods: {
		  // 轮播菜单
		  swiperChange(e){
		  	this.tabIndex = e.detail.current
		  },
		itemClick(item,e){
			 
		},
		  
		getShopList(mescroll) {
			console.log('=====')
			mescroll.endSuccess(this.list.length);
			// if (this.$refs.loadingCover) this.$refs.loadingCover.show();
			  
				 
		},
		changeListStyle() {
			this.isList = !this.isList
		},
		 
		 
		//商品详情
		toDetail(item) {
			// console.log(item)
			 
		},
	  
		 
		//重置数据
		resetData() {
			this.categoryId = 0
			 
			this.isFreeShipping = false
		},
		goodsImg(imgStr) {
			// let imgs = imgStr.split(',');
			// return imgs[0] ? this.$util.img(imgs[0], {
			// 	size: 'mid'
			// }) : this.$util.getDefaultImage().default_goods_img;
		},
		imgError(index) {
			this.goodsList[index].goods_image = this.$util.getDefaultImage().default_goods_img;
		},
		 showPrice(data) {
		 	// let price = data.discount_price;
		 	 
		 	return "price";
		 },
		  
		 tabsClick(){
			 
		 }
	}

}
